@extends('backend.layouts.main')
@section('content')
    <section class="content-header">
        <h1>
            学员用户列表
            <small>学员用户列表</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="{{URL('admin/index')}}"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active"><a href="{{URL('admin/rotaion')}}">学员用户列表</a></li>
        </ol>

    </section>
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                {!!view("backend.student._search",['request'=>$request])->render()!!}
                <!-- /.box-header -->
                    <div class="box-body  table-responsive">
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th style="width: 10px">#</th>
                                <th>真实姓名</th>
                                <th>用户昵称</th>
                                <th>手机号</th>
                                <th>头像</th>
                                <th>性别</th>
                                <th>OPEN_ID</th>
                                <th>地区</th>
                                <th>人员状态</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            @if(!empty($studentDatas[0]->id))
                                @foreach($studentDatas AS $key=>$studentData)
                                    <tr style="color:#888;font-weight:normal">
                                        <td></td>
                                        <td>{{$studentData->real_name}}</td>
                                        <td style="cursor:pointer">
                                            {{$studentData->nickname}}
                                        </td>
                                        <td>{{$studentData->phone?$studentData->phone:"-"}}</td>
                                        <td><img src="{{$studentData->images}}" style="width: 100px;height: 100px"></td>
                                        <td>@if($studentData->sex==1)
                                                男
                                            @endif
                                            @if($studentData->sex==2)
                                                女
                                            @endif
                                            @if($studentData->sex==3)
                                                未知
                                            @endif</td>
                                        <td>{{$studentData->open_id}}</td>
                                        <td>{{$studentData->country}}-{{$studentData->province}}
                                            -{{$studentData->city}} </td>
                                        <td>
                                            @if($studentData->status==0)
                                                <span class="label label-success">启用</span>
                                            @else
                                                <span class="label label-danger">否</span>
                                            @endif
                                        </td>
                                        <td>{{$studentData->created_at}}</td>
                                        <td>
                                            <a type="button" href="student/{{encryptionUrl($studentData->id)}}/edit"
                                               class="btn btn-warning btn-sm"><i class="fa fa-hand-paper-o"></i>购买课程</a>
                                            <a type="button"
                                               href="student/buyLogView/{{encryptionUrl($studentData->id)}}"
                                               class="btn btn-info btn-sm"><i class="fa fa-edit "></i>购买记录</a>
                                        </td>
                                    </tr>
                                @endforeach
                            @else
                                <tr style="color:#888;font-weight:normal">
                                    <td colspan="8" align="center">暂无数据</td>
                                </tr>
                            @endif
                        </table>
                    </div>
                    {!!view("backend.common._page",['datas'=>$studentDatas,'request'=>$request])->render()!!}
                </div>
            </div>
        </div>
    </section>
    {!!view("backend.common.status")->render()!!}
@endsection
